package teacher.action.excel;

import java.util.List;

import teacher.bean.Project;
import teacher.bean.Teacher;
import teacher.service.laohe.ListShow;
import teacher.service.PullPorjectToExcel;

import com.opensymphony.xwork2.ActionContext;

public class excelPro {

	private  int flag;
	private List<Project> projects;
	private int kind;
	public int getKind() {
		return kind;
	}
	public void setKind(int kind) {
		this.kind = kind;
	}
	public int getFlag() {
		return flag;
	}
	public void setFlag(int flag) {
		this.flag = flag;
	}
	public List<Project> getProjects() {
		return projects;
	}
	public void setProjects(List<Project> projects) {
		this.projects = projects;
	}
	public String execute()
	{
		Project project0 =new Project();
		Project project1 =new Project();
		Teacher tea=(Teacher)ActionContext.getContext().getSession().get("teacher");
		project0.setKind(0);
		project1.setKind(1);
		if(flag==0)
		{
			project0.setClass_(0);
			this.setProjects(new ListShow().getProjectByUser(project0, tea));
			new PullPorjectToExcel().projectExcel2(this.getProjects());
		}
		if(flag==1)
		{
			project0.setClass_(1);
			this.setProjects(new ListShow().getProjectByUser(project0, tea));
			new PullPorjectToExcel().projectExcel2(this.getProjects());
		}
		if(flag==2)
		{
			project0.setClass_(2);
			this.setProjects(new ListShow().getProjectByUser(project0, tea));
			new PullPorjectToExcel().projectExcel2(this.getProjects());
		}
		if(flag==3)
		{
			project0.setClass_(3);
			this.setProjects(new ListShow().getProjectByUser(project0, tea));
			new PullPorjectToExcel().projectExcel2(this.getProjects());
		}
		if(flag==4)
		{
			project0.setClass_(4);
			this.setProjects(new ListShow().getProjectByUser(project0, tea));
			new PullPorjectToExcel().projectExcel2(this.getProjects());
		}
		if(flag==5)
		{
			project0.setClass_(5);
			this.setProjects(new ListShow().getProjectByUser(project0, tea));
			new PullPorjectToExcel().projectExcel2(this.getProjects());
		}
		if(flag==6)
		{
			project0.setClass_(6);
			this.setProjects(new ListShow().getProjectByUser(project0, tea));
			new PullPorjectToExcel().projectExcel2(this.getProjects());
		}
		if(flag==7)
		{
			project1.setClass_(0);
			this.setProjects(new ListShow().getProjectByUser(project1, tea));
			new PullPorjectToExcel().projectExcel2(this.getProjects());
		}
		if(flag==8)
		{
			project1.setClass_(1);
			this.setProjects(new ListShow().getProjectByUser(project1, tea));
			new PullPorjectToExcel().projectExcel2(this.getProjects());
		}
		if(flag==9)
		{
			project1.setClass_(2);
			this.setProjects(new ListShow().getProjectByUser(project1, tea));
			new PullPorjectToExcel().projectExcel2(this.getProjects());
		}
		
		return "succ";
	}
}
